Skip to content

pnpm: add detailed completion support#3318

Open
drmikecrowe wants to merge 1 commit intocarapace-sh:masterfrom
drmikecrowe:pnpm-completion
Open

pnpm: add detailed completion support#3318
drmikecrowe wants to merge 1 commit intocarapace-sh:masterfrom
drmikecrowe:pnpm-completion

Conversation

@drmikecrowe
Copy link

Summary

Expands pnpm completion with full flag support, script/workspace awareness, and new action helpers mirroring the npm actions structure.

NOTE: I am not a Go programmer. However, I also didn't simply give this to claude to solve. I've tested, screenshot, corrected and looked closely at what it produced. I'm happy to do more if you need.

New action files (pkg/actions/tools/pnpm/):

  • script.goActionScripts() completes scripts from package.json
  • workspace.goActionWorkspaces() reads pnpm-workspace.yaml or package.json
  • workspace_specific.goActionWorkspaceScripts() (reads scripts across all workspace packages), ActionWorkspaceFilter() (common filter patterns), ActionWorkspaceDependencies()
  • config.goActionLocalConfigKeys() / ActionGlobalConfigKeys()
  • module.goActionModules() completes from node_modules
  • owner.goActionOwners(pkg)
  • package.goActionPackageSearch(), ActionPackageVersions(), ActionPackageTags()
  • store.goActionStorePackages(), ActionStoreAdd()

New completers (completers/common/pnpm_completer/cmd/):

  • cat-file, cat-index, find-hash, help, init

Improvements to existing completers:

  • exec, start — full flag definitions + completions (previously stubs)
  • run — positional script completion via ActionScripts() + ActionWorkspaceScripts()
  • rebuild, remove, update — workspace-aware dependency completion
  • root — global flags (--filter, --loglevel, etc.) with completions; addWorkspaceFlags() helper for --workspace/-w
  • root_root — rename root_rootCmdrootRootCmd (Go naming convention)
  • ActionFilter() — batches workspace filter patterns alongside package names

Test plan

  1. pnpm run <TAB> completes scripts from package.json
  2. pnpm run --filter <TAB> completes package names + patterns like ..., packages/*
  3. pnpm exec --dir <TAB> completes directories
  4. pnpm remove <TAB> completes installed dependencies including workspace packages
  5. pnpm update <TAB> completes dependency names
  6. pnpm start, pnpm exec flag completions work
pnpm1 pnpm3 pnpm6 pnpm5 pnpm4 pnpm2

🤖 Generated in conjunction with Claude Code

- Add 8 new action files (config, module, owner, package, script, store,
  workspace, workspace_specific) mirroring the npm actions structure
- Add missing completers: cat-file, cat-index, find-hash, help, init
- Expand exec, start with full flag definitions and completions
- Add script completion for run positional args (ActionScripts)
- Wire workspace actions: ActionWorkspaceScripts across workspace packages,
  ActionWorkspaceFilter patterns into ActionFilter, ActionWorkspaceDependencies
  into rebuild/remove/update positionals and --workspace flag
- Rename root_rootCmd to rootRootCmd (Go naming convention)
- Add addWorkspaceFlags helper for --workspace/-w completion
- Add local dev artifacts to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant